import request from '@/utils/request'

// 查询月度监控列表
export function listDealMonthlyMonitoring(query) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/list',
    method: 'get',
    params: query
  })
}

// 查询月度监控详细
export function getDealMonthlyMonitoring(id) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/' + id,
    method: 'get'
  })
}

// 获取最接近的上一个月的数据
export function getByDays(dealId) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/getByDays/' + dealId,
    method: 'get'
  })
}

export function getCountByDays(days, dealId, id) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/getCountByDays/' + days + '/' + dealId + '/' + id,
    method: 'get'
  })
}

export function getTypeFormatsBySum(dealId, typeFormats) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/getTypeFormatsBySum/' + dealId + '/' + typeFormats,
    method: 'get'
  })
}

// 保存月度监控
export function saveDealMonthlyMonitoring(data) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/save',
    method: 'post',
    data: data
  })
}

// 删除月度监控
export function delDealMonthlyMonitoring(id) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/' + id,
    method: 'delete'
  })
}

// 导出月度监控
export function exportDealMonthlyMonitoring(query) {
  return request({
    url: '/monthlyMonitoring/dealMonthlyMonitoring/export',
    method: 'get',
    params: query
  })
}
